 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKSms/SmsModel.h>

@implementation SendBatchSms
-(id) initWithStatus:(NSNumber*) status
      code:(NSString*)code
      message:(NSString*)message { 
     self.status = status;               
     self.code = code;               
     self.message = message;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self message])
    {
        [result setValue:[self message] forKey:@"message"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.status = [dictionary objectForKey:@"status"];
    self.code = [dictionary objectForKey:@"code"];
    self.message = [dictionary objectForKey:@"message"];
    return self;
}
 @end
@implementation MtSms
-(id) initWithPin:(NSString*) pin
      expandNum:(NSString*)expandNum
      mobileNum:(NSString*)mobileNum
      appId:(NSString*)appId
      packageId:(NSString*)packageId
      signId:(NSString*)signId
      templateId:(NSString*)templateId
      msgContent:(NSString*)msgContent
      orderId:(NSString*)orderId
      code:(NSNumber*)code
      receiptNum:(NSString*)receiptNum
      splitFlag:(NSString*)splitFlag
      status:(NSString*)status
      type:(NSString*)type { 
     self.pin = pin;               
     self.expandNum = expandNum;               
     self.mobileNum = mobileNum;               
     self.appId = appId;               
     self.packageId = packageId;               
     self.signId = signId;               
     self.templateId = templateId;               
     self.msgContent = msgContent;               
     self.orderId = orderId;               
     self.code = code;               
     self.receiptNum = receiptNum;               
     self.splitFlag = splitFlag;               
     self.status = status;               
     self.type = type;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self pin])
    {
        [result setValue:[self pin] forKey:@"pin"];
    }
    if([self expandNum])
    {
        [result setValue:[self expandNum] forKey:@"expandNum"];
    }
    if([self mobileNum])
    {
        [result setValue:[self mobileNum] forKey:@"mobileNum"];
    }
    if([self appId])
    {
        [result setValue:[self appId] forKey:@"appId"];
    }
    if([self packageId])
    {
        [result setValue:[self packageId] forKey:@"packageId"];
    }
    if([self signId])
    {
        [result setValue:[self signId] forKey:@"signId"];
    }
    if([self templateId])
    {
        [result setValue:[self templateId] forKey:@"templateId"];
    }
    if([self msgContent])
    {
        [result setValue:[self msgContent] forKey:@"msgContent"];
    }
    if([self orderId])
    {
        [result setValue:[self orderId] forKey:@"orderId"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self receiptNum])
    {
        [result setValue:[self receiptNum] forKey:@"receiptNum"];
    }
    if([self splitFlag])
    {
        [result setValue:[self splitFlag] forKey:@"splitFlag"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.pin = [dictionary objectForKey:@"pin"];
    self.expandNum = [dictionary objectForKey:@"expandNum"];
    self.mobileNum = [dictionary objectForKey:@"mobileNum"];
    self.appId = [dictionary objectForKey:@"appId"];
    self.packageId = [dictionary objectForKey:@"packageId"];
    self.signId = [dictionary objectForKey:@"signId"];
    self.templateId = [dictionary objectForKey:@"templateId"];
    self.msgContent = [dictionary objectForKey:@"msgContent"];
    self.orderId = [dictionary objectForKey:@"orderId"];
    self.code = [dictionary objectForKey:@"code"];
    self.receiptNum = [dictionary objectForKey:@"receiptNum"];
    self.splitFlag = [dictionary objectForKey:@"splitFlag"];
    self.status = [dictionary objectForKey:@"status"];
    self.type = [dictionary objectForKey:@"type"];
    return self;
}
 @end
@implementation ReplyResp
-(id) initWithAppId:(NSString*) appId
      signId:(NSString*)signId
      phoneNum:(NSString*)phoneNum
      dataTime:(NSString*)dataTime
      content:(NSString*)content { 
     self.appId = appId;               
     self.signId = signId;               
     self.phoneNum = phoneNum;               
     self.dataTime = dataTime;               
     self.content = content;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self appId])
    {
        [result setValue:[self appId] forKey:@"appId"];
    }
    if([self signId])
    {
        [result setValue:[self signId] forKey:@"signId"];
    }
    if([self phoneNum])
    {
        [result setValue:[self phoneNum] forKey:@"phoneNum"];
    }
    if([self dataTime])
    {
        [result setValue:[self dataTime] forKey:@"dataTime"];
    }
    if([self content])
    {
        [result setValue:[self content] forKey:@"content"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.appId = [dictionary objectForKey:@"appId"];
    self.signId = [dictionary objectForKey:@"signId"];
    self.phoneNum = [dictionary objectForKey:@"phoneNum"];
    self.dataTime = [dictionary objectForKey:@"dataTime"];
    self.content = [dictionary objectForKey:@"content"];
    return self;
}
 @end
@implementation BatchSendResp
-(id) initWithSequenceNumber:(NSString*) sequenceNumber { 
     self.sequenceNumber = sequenceNumber;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self sequenceNumber])
    {
        [result setValue:[self sequenceNumber] forKey:@"sequenceNumber"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.sequenceNumber = [dictionary objectForKey:@"sequenceNumber"];
    return self;
}
 @end
@implementation StatusReportResp
-(id) initWithPhoneNum:(NSString*) phoneNum
      sequenceNumber:(NSString*)sequenceNumber
      sendTime:(NSString*)sendTime
      reportTime:(NSString*)reportTime
      status:(NSNumber*)status
      code:(NSString*)code
      splitNum:(NSNumber*)splitNum { 
     self.phoneNum = phoneNum;               
     self.sequenceNumber = sequenceNumber;               
     self.sendTime = sendTime;               
     self.reportTime = reportTime;               
     self.status = status;               
     self.code = code;               
     self.splitNum = splitNum;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self phoneNum])
    {
        [result setValue:[self phoneNum] forKey:@"phoneNum"];
    }
    if([self sequenceNumber])
    {
        [result setValue:[self sequenceNumber] forKey:@"sequenceNumber"];
    }
    if([self sendTime])
    {
        [result setValue:[self sendTime] forKey:@"sendTime"];
    }
    if([self reportTime])
    {
        [result setValue:[self reportTime] forKey:@"reportTime"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self code])
    {
        [result setValue:[self code] forKey:@"code"];
    }
    if([self splitNum])
    {
        [result setValue:[self splitNum] forKey:@"splitNum"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.phoneNum = [dictionary objectForKey:@"phoneNum"];
    self.sequenceNumber = [dictionary objectForKey:@"sequenceNumber"];
    self.sendTime = [dictionary objectForKey:@"sendTime"];
    self.reportTime = [dictionary objectForKey:@"reportTime"];
    self.status = [dictionary objectForKey:@"status"];
    self.code = [dictionary objectForKey:@"code"];
    self.splitNum = [dictionary objectForKey:@"splitNum"];
    return self;
}
 @end
@implementation PullMtMsgByMobile
-(id) initWithTotal:(NSNumber*) total
      size:(NSNumber*)size
      detailList:(NSArray<MtSms*>*)detailList { 
     self.total = total;               
     self.size = size;               
     self.detailList = detailList;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self total])
    {
        [result setValue:[self total] forKey:@"total"];
    }
    if([self size])
    {
        [result setValue:[self size] forKey:@"size"];
    }
    if([self detailList])
    {
        NSMutableArray<NSDictionary*>* arrayDic  = [[NSMutableArray alloc] init];
        for (int i =0 ; i< [[self detailList] count]; i++) {
            MtSms* item = [[self detailList] objectAtIndex:i];
            [arrayDic addObject:[item dictionary]];
        }
        [result setValue:arrayDic forKey:@"detailList"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.total = [dictionary objectForKey:@"total"];
    self.size = [dictionary objectForKey:@"size"];
    NSArray* detailListArray = [dictionary objectForKey:@"detailList"];
    if(detailListArray&&![detailListArray isKindOfClass:[NSNull class]])
    {
        NSMutableArray* propertyArray = [[NSMutableArray alloc]init];
        for(int i = 0 ; i< [detailListArray count];i++)
        {
            MtSms* item = [[MtSms alloc]initWithDic:[detailListArray objectAtIndex:i]];
            if(item)
            {
                [propertyArray addObject:item];
            }
        }
        self.detailList = propertyArray;
    }
    return self;
}
 @end
 
 


